package com.example.microservicediscoveryeureka.controller;

import com.example.microservicecommon.User;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {


    @Value("${server.port:1}")
    private Integer port;
    @GetMapping("/users")
    public Object findById(){
        return new User("用户名称",""+port);
    }
    @GetMapping("/user/{id}")
    public Object findById(@PathVariable String id){
        return new User("用户名称",id+":"+port);
    }

}
